---
image: {{ .ModuleName }}/{{ .ImageName }}
fromImage: common/distroless
import:
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact
  add: /src/iptables-wrapper
  to: /iptables-wrapper
  before: setup
---
artifact: {{ .ModuleName }}/{{ .ImageName }}-artifact
from: {{ $.Images.BASE_GOLANG_19_ALPINE_DEV }}
mount:
- fromPath: ~/go-pkg-cache
  to: /go/pkg
shell:
  beforeInstall:
  - git clone {{ .SOURCE_REPO }}/kubernetes-sigs/iptables-wrappers.git /src
  - cd /src
  - git reset --hard 680003b3c6e93b471a59ecc9ae87a8f9054b82f3
  install:
  - cd /src
  - GOPROXY={{ .GOPROXY }} GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o iptables-wrapper main.go
  - chown 64535:64535 iptables-wrapper
  - chmod 0755 iptables-wrapper
